package de.zefania.api.impl;

import de.zefania.api.Caption;

/**
 * an object of this class contains one caption (Textcontent and a refering biblevers)
 * @author Thomas
 *
 */
public class CaptionImpl implements Caption {
	private String text;
	private int bnumber;
	private int cnumber;
	private int vnumber;
	/**
	 * creates an caption object by the given text and the given position
	 * @param text
	 * @param bnumber
	 * @param cnumber
	 * @param vnumber
	 */
	public CaptionImpl(final String text, final int bnumber, final int cnumber, final int vnumber) {
		this.text = text;
		this.bnumber = bnumber;
		this.cnumber = cnumber;
		this.vnumber = vnumber;
	}
	/**
	 * creates an caption object by the given text and a position object
	 * only the start position is relevant for the caption
	 * @param text
	 * @param pos
	 */
	public CaptionImpl(final String text, final PositionImpl pos) {
		this.text = text;
		this.bnumber = pos.b1();
		this.cnumber = pos.c1();
		this.vnumber = pos.v1();
	}
	@Override
	public final String getText() {
		return this.text;
	}	
	@Override
	public final PositionImpl getPosition() {		
		return new PositionImpl(bnumber, cnumber, vnumber);
	}
	
	public final int getBnumber() {
		return this.bnumber;
	}	
	public final int getCnumber() {
		return this.cnumber;
	}
	public final int getVnumber() {
		return this.vnumber;
	}
}
